<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>JQueryPrintTest</title>
  <link rel="stylesheet" href="css/sample.css">
  <script src="node_modules/jquery/dist/jquery.js"></script>
  <script src="node_modules/jQuery.print/jQuery.print.js"></script>
</head>

<body>
  <div>
    <button type="button" id="prtbutton">打印</button>
  </div>
  <p></p>
  <p></p>
  <p></p>
  <p></p>
  <div id="my_print_content">

    <div class="center hiddenprint">
      <p>打印时隐藏标题信息</p>
      <p>打印时隐藏标题信息</p>
      <p>打印时隐藏标题信息</p>
    </div>
    <div>
      <table border="0" cellpadding="10">
        <thead>
          <tr class="tabletitle">
            <td>姓名</td>
            <td>性别</td>
          </tr>
        </thead>
        <tbody>
          <tr class="tablerow">
            <td>张三</td>
            <td>男</td>
          </tr>
          <tr class="tablerow">
            <td>李四</td>
            <td>女</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div>
      <span>开票人：XXX</span> 日期：<b>2017.10.10</b>
    </div>
  </div>
  <script src="js/printsample.js"></script>
</body>

</html>
